package org.ghost.wechat.platform.dao;

import org.ghost.wechat.platform.common.http.annotation.HttpClientEx;
import org.ghost.wechat.platform.common.http.annotation.RequestMappingEx;
import org.ghost.wechat.platform.dto.wechat.message.WeChatMsgSendRspDTO;
import org.ghost.wechat.platform.dto.wechat.message.WeChatMsgTemplateDTO;
import org.springframework.http.HttpMethod;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 01
 * https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html
 */
@HttpClientEx(hostName = "https://api.weixin.qq.com")
public interface IWeChatMessageDAO {
    /**
     * 推送模板消息
     *
     * @param accessToken    接口调用需要的access_token
     * @param msgTemplateDTO 消息内容
     * @return
     */
    @RequestMappingEx(name = "cgi-bin/message/template/send", method = HttpMethod.POST)
    WeChatMsgSendRspDTO sendTemplateMessage(@RequestParam(value = "access_token") String accessToken, @RequestBody WeChatMsgTemplateDTO msgTemplateDTO);
}
